name Fanuc 11M

% 00
/ 00
O >4
N >4
G >2
X ->3.>4
Y ->3.>4
Z ->3.>4
A ->3.>4
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P >40
F >3.1
H >2
D >2
T >2
M >2
S >4


ModalLetters X Y Z F R                # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? N                             # Y or N  'Spaces between words     
Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[Frate] Q[VBite]
end cancel

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] R[Vclear] F[Frate] Q[VBite]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
%0
O[Program#]
G90 G80 G40 G17
End

1stToolChange                         # First tool change                 
T[Tool] M6
M[Direct] S[Speed]
G0 G[Work] X[H] Y[V]
G43 Z[D] H[Lcomp]
M[Cool]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] F[FRate]
end


Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
end

ToolChange                            # Secondary tool changes            
N[Block] T[Tool] M6
M[Direct] S[Speed]
G0 X[H] Y[V]
G43 Z[D] H[Lcomp]
M[Cool]
End

EndCode                               # End of the program                
G90 G0 G49 Z0
M6 T[Tool1]
X0 Y0
M2
%0
End

name Fanuc 11M 4 Axis

% 00
/ 00
O >4
N >4
G >2
g >2 G
X ->3.>4
Y ->3.>4
Z ->3.>4
A ->3.>3 Limit -180 180
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P ->3.>4
F >3.2
H >2
D >2
T >2
M >2
S >4

ModalLetters X Y Z F                  # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? Y
Spaces? Y                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments


Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[Frate]
end cancel

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

Index X                               # Index the rotary table            
G0 G28 g91 Z0
G90 G0 G[Work] X[H] Y[V] A[RotAngle]
G43 Z[D] H[Lcomp]
End

UnWind                                # Unwind the rotary table           
G0 G28 g91 Z0
G90 G0 A0
G43 Z[D] H[Lcomp]
G0 X[LastH] Y[LastV] A[LastRotAng]
G1 Z[LastD]
End

StartCode                             # Start of the program              
O[Program#]
g91 G28 Z0
G90
End

1stToolChange                         # First tool change                 
/0 N[Block] T[Tool] M6
G0 G40 G80 G[Work] X[H] Y[V] A[RotAngle]
G43 Z[D] H[Lcomp] M[Direct] S[Speed]
M[Cool] T[NextTool]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] F[Frate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
M9
G0 G28 g91 Z0
N[Block] M6
G0 G90 G[Work] X[H] Y[V] A[RotAngle]
G43 Z[D] H[Lcomp] M[Direct] S[Speed]
M[Cool] T[NextTool]
End

EndCode                               # End of the program                
G0 G28 g91 Z0
G28 g91 X0 Y0 M6 A0
G90
M30
End

name Fadal Format 1

% 00
/ 00
O >4
L >4
N >4
G >2
S >4
H >2
D >2
M >2
T >2
R ->3.>4
z ->3.>4 Z
E >2
X ->3.>4
Y ->3.>4
Z ->3.>4
I ->3.>4
J ->3.>4
K ->3.>4
F >4.>2
Q ->3.>4
P ->3.>4
( 00
d >3.>4
e >3.>4
f >3.>4

ModalLetters X Y Z F                  # List of letters that are modal

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal

Sequence#s N 0 1 1                    # Char, freq, incr & start
First#? N                             # Y or N  'Output 1st sequence no.
Last#? N                              # Y or N  'Output last sequence no.

HCode X                               # X or X U  'Horizontal char.
VCode Y                               # Y or Y V  'Vertical char.
Dcode Z                               # Depth char.
FeedCode F                            # Feed rate char.

Comment ( )                           # Begin End comment char.

Spindle 3 4 5                         # Cw, ccw & stop m codes
Coolant 7 9 8                         # On, Off & Mist m codes
DComp 41 42 40                        # Left, Right & Cancel m codes
LComp 43 49                           # On & Off codes

Feed G1                               # Linear move
Rapid G0                              # Rapid positioning word
Cw G2                                 # Circular move clockwise
Ccw G3                                # Circular move counter clockwise
Inc/Abs G 91 90                       # Inc & Abs char. & values
CtrCode I J                           # I J or R or I J K L
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words

Incremental? N                        # Y or N  'Inc or abs output
CtrIncremental? Y                     # Y or N  'Inc or abs I & J
ByQuadrants? N                        # Y or N  'Break arcs at quadrants

UppercaseComments? Y                  # Y or N 'Require uppercase comments

WorkDefault 1                         # Work offset register default

Drill                                 # Drilling canned/manual cycle
G81 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Peck                                  # Pecking canned/manual cycle
G83 G99 R[Vclear] z[D] F[FRate] Q[VBite] X[H] Y[V]
end cancel

LTap                                  # Left handed tapping cycle
G74 G99 R[Vclear] z[D] F[Frate] Q[VBite] X[H] Y[V]
end cancel

Tap                                   # Tapping canned/manual cycle
G84 G99 R[Vclear] z[D] F[Frate] Q[VBite] X[H] Y[V]
end cancel

Ream                                  # Reaming canned/manual cycle
G85 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Bore                                  # Boring canned/manual cycle
G86 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Back                                  # Back boring canned/manual cycle
G76 G99 R[Vclear] z[D] F[FRate] Q[Sclear] X[H] Y[V]
end cancel

Cancel                                # Cancel a canned/manual cycle
G80
end

StartCode                             # Start of the program
%0
O[Program#]
End

1stToolChange                         # First tool change
M6 T[Tool] (0 d[ToolRad] e[ToolDiam] f[corner]
G0 G90 S[Speed] M[Direct] E[Work] X[H] Y[V]
H[Lcomp] M[Cool] Z[D]
End

Infeed                                # Enable cutter comp
G1 G[Side] X[H] Y[V] F[FRate]
end

Outfeed                               # Disable cutter comp
G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes
M5 M9
G0 G49 G90 Z0
M6 T[Tool] (0 d[ToolRad] e[ToolDiam] f[corner]
G0 G90 S[Speed] M[Direct] E[Work] X[H] Y[V]
H[Lcomp] M[Cool] Z[D]
End

EndCode                               # End of the program
M5 M9
G0 G49 G90 Z0
E0 X0 Y0
M6 T[Tool1]
M2
%0
End

replace "d" with "Tool Radius: "
replace "e" with "Diam: "
replace "f" with "Corner Rad.: "

name Fadal Format 1 4 Axis

% 00
/ 00
O >4
L >4
N >4
G >2
S >4
H >2
D >2
M >2
T >2
R ->3.>4
z ->3.>4 Z
E >2
X ->3.>4
Y ->3.>4
Z ->3.>4
A ->3.>3 Limit -359.999 0 Incsign
I ->3.>4
J ->3.>4
K ->3.>4
F >4.>2
Q ->3.>4
P ->3.>4
( 00
d >3.>4
e >3.>4
f >3.>4

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal

ModalLetters X Y Z F A                # List of letters that are modal

Sequence#s N 1 1 1                    # Char, freq, incr & start
First#? N                             # Y or N  'Output 1st sequence no.
Last#? N                              # Y or N  'Output last sequence no.

HCode X                               # X or X U  'Horizontal char.
VCode Y                               # Y or Y V  'Vertical char.
Dcode Z                               # Depth char.
FeedCode F                            # Feed rate char.

Comment ( )                           # Begin End comment char.

Spindle 3 4 5                         # Cw, ccw & stop m codes
Coolant 7 9 8                         # On, Off & Mist m codes
DComp 41 42 40                        # Left, Right & Cancel m codes
LComp 43 49                           # On & Off codes

Feed G1                               # Linear move
Rapid G0                              # Rapid positioning word
Cw G2                                 # Circular move clockwise
Ccw G3                                # Circular move counter clockwise

Inc/Abs G 91 90                       # Inc & Abs char. & values

CtrCode I J                           # I J or R or I J K L
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words

RevSigns A                            # List of letters to reverse signs

Incremental? N                        # Y or N  'Inc or abs output
CtrIncremental? Y                     # Y or N  'Inc or abs I & J
ByQuadrants? N                        # Y or N  'Break arcs at quadrants

UppercaseComments? Y                  # Y or N 'Require uppercase comments

WorkDefault 1                         # Work offset register default

Drill                                 # Drilling canned/manual cycle
G81 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Peck                                  # Pecking canned/manual cycle
G83 G99 R[Vclear] z[D] F[FRate] Q[VBite] X[H] Y[V]
end cancel

Tap                                   # Tapping canned/manual cycle
G84 G99 R[Vclear] z[D] F[Frate] Q[VBite] X[H] Y[V]
end cancel

LTap                                  # Left handed tapping cycle
G74 G99 R[Vclear] z[D] F[Frate] Q[VBite] X[H] Y[V]
end cancel

Ream                                  # Reaming canned/manual cycle
G85 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Bore                                  # Boring canned/manual cycle
G86 G99 R[Vclear] z[D] F[FRate] X[H] Y[V]
end cancel

Back                                  # Back boring canned/manual cycle
G76 G99 R[Vclear] z[D] F[FRate] Q[Sclear] X[H] Y[V]
end cancel

Cancel                                # Cancel a canned/manual cycle
G80
end

Index X                               # Index the rotary table
G0 G49 G90 Z0
X[H] Y[V] A[RotAngle]
E[Work]
H[Lcomp] M[Cool] Z[D]
end

StartCode                             # Start of the program
%0
O[Program#]
End

1stToolChange                         # First tool change
M6 T[Tool] (0 d[ToolRad] e[ToolDiam] f[corner]
G0 G90 S[Speed] M[Direct] X[H] Y[V] A[Rotangle]
H[Lcomp] M[Cool] Z[D]
End

Infeed                                # Enable cutter comp
G1 G[Side] X[H] Y[V] A[Rotangle] F[FRate]
end

Outfeed                               # Disable cutter comp
G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes
M5 M9
G0 G49 G90 Z0
M6 T[Tool] (0 d[ToolRad] e[ToolDiam] f[corner]
G0 G90 S[Speed] M[Direct] X[H] Y[V] A[Rotangle]
H[Lcomp] M[Cool] Z[D]
End

EndCode                               # End of the program
M5 M9
G0 G49 G90 Z0
E0 X0 Y0
M6 T[Tool1]
M2
%0
End

replace "d" with "Tool Radius: "
replace "e" with "Diam: "
replace "f" with "Corner Rad.: "

name HAAS

% 00
/ 00
O >4
N >4
G >2
g >2 G
X ->3.>4
Y ->3.>4
Z ->3.>4
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P >40
F >3.1
H >2
D >2
T >2
M >2
S >4

ModalLetters X Y Z F                  # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[Frate] Q[VBite]
end cancel

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
%0
O[Program#]
G90 G80 G40 G17
End

1stToolChange                         # First tool change                 
T[Tool] M6
M[Direct] S[Speed]
G0 G[Work] X[H] Y[V]
Z[D] H[Lcomp]
M[Cool]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
G0 G49 Z0 M9
T[Tool] M6
G0 G90 G[Work] X[H] Y[V] S[Speed] M[Direct]
G43 Z[D] H[Lcomp] M[Cool]
End

EndCode                               # End of the program                
G0 G49 G90 Z0 M9
G28 g91 Y0 Z0
M30
%0
End

name HAAS 4 axis

% 00
/ 00
O >4
N >4
G >2
g >2 G
X ->3.>4
Y ->3.>4
Z ->3.>4
A ->3.>4 Limit -8000 8000
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P >40
F >3.1
H >2
D >2
T >2
M >2
S >4

ModalLetters X Y Z F A                # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[Frate] Q[VBite]
end cancel

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

Index X                               # Index the rotary table            
G0 G49 G90 Z0
G[Work] X[H] Y[V] A[Rotangle]
G43 Z[D] H[Lcomp] M[Cool]
End

UnWind                                # Unwind the rotary table           
G0 G49 G90 Z0
A0
G43 Z[D] H[Lcomp] M[Cool]
G0 X[LastH] Y[LastV] A[LastRotAng]
G1 Z[LastD]
End

StartCode                             # Start of the program              
%0
O[Program#]
G90 G80 G40 G17
End

1stToolChange                         # First tool change                 
T[Tool] M6
M[Direct] S[Speed]
G0 G[Work] X[H] Y[V] A[Rotangle]
Z[D] H[Lcomp]
M[Cool]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] A[Rotangle] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
G0 G49 Z0 M9
N[Block] T[Tool] M6
G0 G90 G[Work] X[H] Y[V] S[Speed] M[Direct] A[Rotangle]
G43 Z[D] H[Lcomp] M[Cool]
End

EndCode                               # End of the program                
G0 G49 G90 Z0 M9
G28 g91 Y0 Z0 A0
M30
%0
End

name Mazak M32

% 00
/ 00
O >4
N >4
G >2
X ->34
Y ->34
Z ->34
A ->34
I ->34
J ->34
K ->34
Q ->34
R ->34
F >44
H >3
D >3
T >3
M >2
S >5

ModalLetters X Y Z F R                # List of letters that are modal    

ModalGs                               # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

ZRestart? Y                           # Y or N  'New cycle if diff. depths

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[FRate] Q[VBite]
end cancel

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] R[Vclear] F[Frate] Q[VBite]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
%0
O[Program#]
G90 G80 G40 G17
End

1stToolChange                         # First tool change                 
G28 Z0 T[Tool] M6
M[Direct] S[Speed]
G90 G0 G[Work] X[H] Y[V]
G43 Z[D] H[Lcomp]
M[Cool]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
end

ToolChange                            # Secondary tool changes            
M9
G0 G28 Z0
M1
T[Tool] M6
M[Direct] S[Speed]
G90 G0 G[WORK] X[H] Y[V]
G43 Z[D] H[Lcomp]
M[Cool]
End

EndCode                               # End of the program                
M9
G0 G28 Z0
M6 T[Tool1]
G90 G0 X0 Y0
M02
%0
End

name Mazak M2 4 Axis

% 00
/ 00
O >4
N >4
G >2
g >2 G
X ->3.>4
Y ->3.>4
Z ->3.>4
A ->3.>3 Limit -360 360
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P ->3.>4
F >3.2
H >2
D >2
T >2
M >2
S >4

ModalLetters X Y Z F A                # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   
CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

Inc/Abs G 91 90                       # Inc & Abs char. & values          

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G98 G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G98 G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G98 G84 X[H] Y[V] Z[D] R[Vclear] F[FRate] P[Dwell]
end cancel

LTap                                  # Left handed tapping cycle         
G98 G74 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G98 G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G98 G86 X[H] Y[V] Z[D] R[Vclear] F[FRate] P[Dwell]
end cancel

Back                                  # Back boring canned/manual cycle   
G98 G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

Index X                               # Index the rotary table            
G0 G28 g91 Z0
A[RotAngle]
G90 G0 G[Work] X[H] Y[V]
Z[D] M[Cool]
End

StartCode                             # Start of the program              
%0
O[Program#]
End

1stToolChange                         # First tool change                 
G0 G40 G80
g91 G28 Z0
G30 X0 Y0
N[Block] T[Tool]
M6
M[val1]
G0 A[RotAngle]
G0 G90 G[Work] X[H] Y[V]
Z[D] M[Direct] S[Speed]
M[Cool] T[NextTool]
End

Infeed                                # Enable cutter comp                
G17 G[Side] X[H] Y[V] D[DComp] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
M9
G28 g91 Z0
G30 X0 Y0
N[Block] T[Tool]
M6
M[val1]
G0 A[RotAngle]
G0 G90 G[Work] X[H] Y[V]
Z[D] M[Direct] S[Speed]
M[Cool] T[NextTool]
End

EndCode                               # End of the program                
G28 g91 Z0
G28 g91 X0 Y0 A0
M30
%0
End

ask [val1] " Enter spindle range or press enter for default: " "38"

name Allen Bradley 8400

% 00
N >4
G >2
O >4
X ->3.>4
Y ->3.>4
Z ->3.>4
R ->3.>4
I ->3.>4
P ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
F >4.1
D >2
T >2
M >2
S >4

ModalLetters X Y Z F R P K            # List of letters that are modal    

ModalGs 73 74 76 81 82 83 84 85       # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ;                             # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   
Inc/Abs G 91 90                       # Inc & Abs char. & values          
CtrCode I J                           # I J or R or I J K L               
Helical? Y

Spaces? Y                             # Y or N  'Spaces between words     
Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? N                     # Y or N  'Inc or abs I & J         
ByQuadrants? Y                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments

WorkDefault 1                         # Work offset register default      

LTap                                  # Left handed tapping cycle         
G74 X[H] Y[V] Z[D] F[Frate] I[VBite]
end cancel

Drill                                 # Drilling canned/manual cycle      
G92 Z[RPlane]
G81 X[H] Y[V] Z[D] R[VClear] P[RPlane] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G92 Z[RPlane]
G83 X[H] Y[V] Z[D] R[VClear] P[RPlane] K[VBite] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] F[Frate] K[VBite]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
End

1stToolChange                         # First tool change                 
G99
G90
O0
G0 Z0
G45 O[Work]
O[Tool]
M[Direct] S[Speed]
M[Cool]
G0 X[H] Y[V] Z[RPlane]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] D[DComp] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V] Z[RPlane]
end

ToolChange                            # Secondary tool changes            
O0
M9
M5
M06
G45 O[Work]
O[Tool]
M[Direct] S[Speed]
M[Cool]
G0 X[H] Y[V] Z[RPlane]
End

CwCode
G2 X[H] Y[V] Z[D] I[Ival] J[Jval] F[Frate]
End

CcwCode
G3 X[H] Y[V] Z[D] I[Ival] J[Jval] F[Frate]
End

EndCode                               # End of the program                
O0
M9
G99
Z0
M2
End

name Cincinnati Milacron 950MC B Axis Indexing

% 00
: 00
/ 00
O >2
N >4
G >2
e 00
X ->3.>4
Y ->3.>4
Z ->3.>4
B ->3.>3
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
P >40
S >4
F >3.1
H >2
D >2
b 00
T >2
c 00
M >2
U ->3.>4
V ->3.>4
j >1 J
m >6
) 00

ModalLetters X Y Z B F R              # List of letters that are modal    

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 0 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment (MSG,                         # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   
Inc/Abs G 91 90                       # Inc & Abs char. & values          
Work G                                # Work offset register              
CtrCode I J                           # I J or R or I J K L               
Helical? N

Spaces? Y                             # Y or N  'Spaces between words     
Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? N                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments


Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ask [Val10] " Enter 1 for full retract peck cycle, or 0 for chip-break: " "1"

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] K[VBite] R[Vclear] F[FRate] j[Val10]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] U0 V[SClear] I0 K0 R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

Index Y                               # Index the rotary table            
M26
B[Rotangle]
Z[Rplane] H[Lcomp]
End

StartCode                             # Start of the program              
%0
:0 G0
m[Program#] )0
End

1stToolChange                         # First tool change                 
T[Tool] M6
S[Speed] F[FRate] M[Direct] M[Cool]
G0 X[H] Y[V] Z[D] H[LComp]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
end

ToolChange                            # Secondary tool changes            
T[Tool] M6
S[Speed] F[FRate] M[Direct] M[Cool]
G0 X[H] Y[V] Z[D]
End

EndCode                               # End of the program                
M2
%0
End

Replace "e" with "="
Replace "b" with "["
Replace "c" with "]"
Replace "m" with "(MSG,PROGRAM NO. "

name Dynapath Delta 20 Conversational

N >4
G >2 (
X ->3.>4
Y ->3.>4
Z ->3.>4
I ->3.>4
J ->3.>4
K ->3.>4
Q ->3.>4
R ->3.>4
W ->3.>4
P ->3.>4
F >3.1
L >3.3
H >2
D >2
T >2
M >2
S >4
U >2 G
E >2
$ 00
e 00

ModalLetters X Y Z F W U              # List of letters that are modal    

ModalGs                               # List of g codes that are modal    

Sequence#s N 1 2 2                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )$                          # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            

Inc/Abs G 91 90                       # Inc & Abs char. & values          

Work G                                # Work offset register              

CtrCode I J                           # I J or R or I J K L               
Helical? N

Spaces? N                             # Y or N  'Spaces between words     
Incremental? N                        # Y or N  'Inc or abs output        
CtrCode I J                           # I J or R or I J K L               

Cw G2                                 # Circular move clockwise           
Ccw G2                                # Circular move counter clockwise   
CtrIncremental? N                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

Each $0                                # End of block word                 

UppercaseComments? Y                  # Y or N 'Require uppercase comments

WorkDefault 1                         # Work offset register default      

Drill 1                               # Drilling canned/manual cycle      
G0 X[H] Y[V] Z[D] U1 W[Vclear] F[FRate]
G0 X[H] Y[V]
end cancel

Peck 1                                # Pecking canned/manual cycle       
G0 X[H] Y[V] Z[D] U3 K[VBite] W[Vclear] F[FRate]
G0 X[H] Y[V]
end cancel

Tap 1                                 # Tapping canned/manual cycle       
G0 X[H] Y[V] Z[D] U4 W[Vclear] F[Frate]
G0 X[H] Y[V]
end cancel

Ream                                  # Reaming canned/manual cycle       
G0 X[H] Y[V] Z[D] U2 W[Vclear] F[FRate]
G0 X[H] Y[V]
end cancel

Bore                                  # Boring canned/manual cycle        
G0 X[H] Y[V] Z[D] U7 W[Vclear] F[FRate]
G0 X[H] Y[V]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G0 U0
end

StartCode                             # Start of the program              
G[Program#]
End

1stToolChange                         # First tool change                 
G9 T[Tool] M6 E[Work]
G9 M[Cool]
G9 M[Direct] S[Speed]
G0 X[H] Y[V]
G0 Z[D]
End

Infeed                                # Enable cutter comp                
G1 Z[D] F[Plunge]
G1 X[H] Y[V] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 X[H] Y[V]
end

ToolChange                            # Secondary tool changes            
G9 M6 S100
G9 T[Tool] M3 S[Speed] E[Work]
G9 M[Cool]
G0 X[H] Y[V]
G0 Z[D]
End

EndCode                               # End of the program                
G9 M30
e0
End

CwCode                                # CW circular move                  
G2 X[H] Y[V] I[IVal] J[JVal] D0 F[FRate]
End

CcwCode                               # CCW circular move                 
G2 X[H] Y[V] I[IVal] J[JVal] D1 F[FRate]
End

Replace "e" with "END"

name GE 2000

% 00
N >4
G 2
X -3.>4
Y -3.>4
R -3.>4
Z -3.>4
H -3.>4
I -3.>4
J -3.>4
Q -3.>4
P -3.>4
F 3.>2
K -3.>4
D 2
S 2
T 2
M 2
s >5
t >5 ,
u 00

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

Sequence#s N 1 5 5                    # Char, freq, incr & start          

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spaces? Y                             # Y or N  'Spaces between words     

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    
Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            

Inc/Abs G 91 90                       # Inc & Abs char. & values          

Work G                                # Work offset register              

Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? Y                        # Y or N  'Break arcs at quadrants  
CtrCode I J                           # I J or R or I J K L               
Helical? N

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill                                 # Drilling canned/manual cycle      
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Peck                                  # Pecking canned/manual cycle       
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel

Tap                                   # Tapping canned/manual cycle       
G84 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Ream                                  # Reaming canned/manual cycle       
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Bore                                  # Boring canned/manual cycle        
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Back                                  # Back boring canned/manual cycle   
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
s[Program#] t[Program#] u0
G90 G17
End

1stToolChange                         # First tool change                 
G90 S[Speed] M[Direct]
T[Tool] M6
G0 X[H] Y[V]
Z[D]
End

Infeed                                # Enable cutter comp                
G[Side] X[H] Y[V] F[FRate]
end

Outfeed                               # Disable cutter comp               
G40 X[H] Y[V]
end

ToolChange                            # Secondary tool changes            
M1
G49 Z0 M5
T[Tool]
M6 S[Speed]
G0 X[H] Y[V]
G43 Z[D] H[Lcomp]
M[cool]
End

EndCode                               # End of the program                
M9
G49 Z0 M5
G0 X0 Y0
M30
End

Replace "s" with "(ID,PROG,"
Replace "u" with ",0)"

name Heidenhain TNC 415 Conversational Sub Program

O >80
  a 80
e >8
i 20
N >3 ""
t >2
u >2
L 00
l +->3.>4 L
C >2
d >2.1
X +->3.>4
Y +->3.>4
Z +->3.>4
G >2
p 00
  I ->3.>4
  J ->3.>4
  A
  B
  Q ->3.>4
H 00 Z
W 00
R ->3.>4
  P ->3.>4
F >3
f >3 F
  K ->3.>4
q >3
M >2
S >4
s ->3.>4
z ->3.>4 Mult -1
Q ->3.>4 Mult -1
w ->3.>4

ModalLetters Z                        # List of letters that are modal    

ModalGs                               # List of g codes that are modal    

Sequence#s N 1 1 0                    # Char, freq, incr & start          
First#? Y                             # Y or N  'Output 1st sequence no.  

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
Dcode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 8                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  
CtrCode I J                           # I J or R or I J K L               
Helical? N
MaxRad 999 .010

Feed L10                              # Linear move                       
Rapid L10 f9998                       # Rapid positioning word            
                                      # Circular move clockwise           
                                      # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

Inch/MM 70 71                         # Inch & Metric g codes             

Subs1st? N                            # Y or N 'Orders main & sub programs

RenumSubs? Y                          # Y or N  'Resets sub's sequence no.

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill 7                               # Drilling canned/manual cycle      
d1
d1.1 s[-2]
d1.2 z[Depth]
d1.3 Q[Depth]
d1.4 w[Dwell]
d1.5 F[FRate]
L10 X[LastH] Y[LastV] Z[VClear] R0 F9998 M99
L10 X[H] Y[V] Z[VClear] R0 F9998 M99
end

Peck 7                                # Pecking canned/manual cycle       
d1
d1.1 s[-2]
d1.2 z[Depth]
d1.3 Q[VBite]
d1.4 w[Dwell]
d1.5 F[FRate]
L10 X[LastH] Y[LastV] Z[VClear] R0 F9998 M99
L10 X[H] Y[V] R0 F9998 M99
end

Tap 6                                 # Tapping canned/manual cycle       
d2
d2.1 s[-2]
d2.2 z[Depth]
d2.3 w[Dwell]
d2.4 F[FRate]
L10 X[LastH] Y[LastV] Z[VClear] R0 F9998 M99
L10 X[H] Y[V] R0 F9998 M99
end

StartCode                             # Start of the program              
O[Program#] i[unitmode]
End

1stToolChange                         # First tool change                 
t[Tool] l0 R[ToolRad]
u[Tool] H[Lcomp] S[Speed]
L10 Z[ToolD] R0 F9998
L10 X0 Y0 R0 F9998 M3
L10 Z0 R0 M[Cool]
End

Infeed                                # Enable cutter comp                
L10 X[H] Y[V] G[Side] F[FRate]
end

Outfeed                               # Disable cutter comp               
L10 R0 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
L10 Z[ToolD] R0 F9998
t[Tool] l0 R[ToolRad]
u[Tool] H[Lcomp] S[Speed]
L10 Z0 R0 F9998
L10 X0 Y0 R0 F9998 M3
L10 Z0 R0 M[Cool]
End

CwCode                                # CW circular move                  
C1 X[HCtr] Y[VCtr]
C0 X[H] Y[V] G2 W0
end

CcwCode                               # CCW circular move                 
C1 X[HCtr] Y[VCtr]
C0 X[H] Y[V] G3 W0
end

Between                               # Between the main and sub programs 
L10 Z[ToolD] R0 F9998
M30
e[Program#] i[unitmode]
End

SubCall                               # Call a sub program                
  L10 X[H] Y[V] W0
  L10 Z[D] R0 W0
d7.0 p0
d7.1 X0
d7.2 Y0
d7.3 Z0
q[Sub]
End

SubStart                              # Start of the sub program          
ask [Val1] " Enter X subroutine offset amount"
ask [Val2] " Enter Y subroutine offset amount"
ask [Val3] " Enter Z subroutine offset amount"
O[Sub] i[Unitmode]
End

SubEnd                                # End of the sub program            
L10 X0 Y0 W0
L10 Z0 R0 W0
d7.0 p0
d7.1 X[Val1]
d7.2 Y[Val2]
d7.3 Z[Val3]
e[SUB] i[unitmode]
End

Replace "O" with "BEGIN PGM "
Replace "i70" with "INCH"
Replace "i71" with "MM"
Replace "e" with "END PGM "
Replace "G41 " with "RL "
Replace "G42 " with "RR "
  #Replace "R0 " with "R "
Replace "t" with "TOOL DEF "
Replace "u" with "TOOL CALL "
Replace "W " with "R F M "
Replace "M0" with "STOP"

Replace "G2 " with "DR- "
Replace "G3 " with "DR+ "
Replace "C1 " with "CC "
Replace "C0 " with "C "

Replace "d" with "CYCL DEF "
  #Replace "EF 0.0 " with "EF 1.0 T"
  #Replace "EF 1.0" with "EF 1.0 T"
  #Replace "EF 2.0" with "EF 2.0 G"
Replace "s" with "A "
Replace "z" with "T "
Replace "Q" with "Z "
Replace "w" with "V "
Replace "q" with "CALL PGM"
Replace "p" with "POINT ZERO"
  replace " a" with ""

name Okuma OSP5000

% 00
O >4
N >4
n 4
G 2
X ->3.>4
Y ->3.>4
Z ->3.>4
I ->3.>4
J ->3.>4
Q ->3.>4
R ->3.>4
P ->3.>4
F >3.2
K ->3.>4
d ->3.>4
H 2
D 2
T 2
M 2
S 4
) 00

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # List of g codes that are modal    

ModalLetters X Y Z R F                # List of letters that are modal    

Sequence#s N 1 10 10                  # Char, freq, incr & start          
Spaces? Y                             # Y or N  'Spaces between words     
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Y                               # Y or Y V  'Vertical char.         
DCode Z                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            

Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   
CtrIncremental? Y                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I J                           # I J or R or I J K L               
Helical? N

UppercaseComments? Y                  # Y or N 'Require uppercase comments

WorkDefault 1                         # Work offset register default      


Drill                                 # Drilling canned/manual cycle      
G71 Z[RPlane]
G81 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

Peck                                  # Pecking canned/manual cycle       
G71 Z[RPlane]
G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate] M53
end cancel

Tap                                   # Tapping canned/manual cycle       
G71 Z[RPlane]
G84 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

LTap                                  # Left handed tapping cycle         
G71 Z[RPlane]
G74 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

Ream                                  # Reaming canned/manual cycle       
G71 Z[RPlane]
G85 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

Bore                                  # Boring canned/manual cycle        
G71 Z[RPlane]
G86 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

Back                                  # Back boring canned/manual cycle   
G71 Z[RPlane]
G87 X[H] Y[V] Z[D] R[Vclear] F[FRate] M53
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

StartCode                             # Start of the program              
%0
n9999
G15 H[Work]
End

1stToolChange                         # First tool change                 
d[Tool] )0
T[Tool]
M6
T[NextTool]
M[Direct] S[Speed]
G0 G90 X[H] Y[V]
G56 Z[D] H[LComp]
M[Cool]
End

Infeed                                # Enable cutter comp                
G1 Z[D] F[Plunge]
G[Side] X[H] Y[V] H[DComp] F[FRate]
end

Outfeed                               # Disable cutter comp               
G1 G40 X[H] Y[V]
Z[D]
end

ToolChange                            # Secondary tool changes            
G0 Z[D] M9
O9999 M01
d[Tool] )0
M6
T[NextTool]
M[Direct] S[Speed]
G0 G90 X[H] Y[V]
G56 Z[D] H[Lcomp]
M[Cool]
End

EndCode                               # End of the program                
G80 G90 Z8.0
G90 X0 Y15.0
M6
M30
%0
End

Replace "O9999" with "NRST"
Replace "n9999" with "( Okuma OSP5000 - Machine# 0109 )"
Replace "d" with "(      Tool No.  "

name Maho XY Plane (G18)

% 00
! 00
N >9
G >2
g >2 G
B ->3.>4
b ->3.>4 B
X ->3.>4
x ->3.>4 X
Y ->3.>4
y ->3.>4 Y
Z ->3.>4 Mult -1
z ->3.>4 Z Mult -1
I ->3.>4
i ->3.>4 I
J ->3.>4
K ->3.>4 Mult -1
k ->3.>4 K
F >3.1
T >2
M >2
S >4
W 00 

ModalLetters X Y Z F B                # List of letters that are modal    

ModalGs 0 1 2 3 81 83 84              # List of g codes that are modal    

Sequence#s N 1 1 1                    # Char, freq, incr & start          
First#? N                             # Y or N  'Output 1st sequence no.  
Last#? N                              # Y or N  'Output last sequence no. 

HCode X                               # X or X U  'Horizontal char.       
VCode Z                               # Y or Y V  'Vertical char.         
Dcode Y                               # Depth char.                       
FeedCode F                            # Feed rate char.                   

Comment ( )                           # Begin End comment char.           

Spindle 3 4 5                         # Cw, ccw & stop m codes            
Coolant 8 9 7                         # On, Off & Mist m codes            
DComp 41 42 40                        # Left, Right & Cancel m codes      
LComp 43 49                           # On & Off codes                    

Feed G1                               # Linear move                       
Rapid G0                              # Rapid positioning word            
Cw G2                                 # Circular move clockwise           
Ccw G3                                # Circular move counter clockwise   

Inc/Abs G 91 90                       # Inc & Abs char. & values          

CtrCode I K                           # I J or R or I J K L               
Helical? N

Spaces? N                             # Y or N  'Spaces between words     

Incremental? N                        # Y or N  'Inc or abs output        
CtrIncremental? N                     # Y or N  'Inc or abs I & J         
ByQuadrants? N                        # Y or N  'Break arcs at quadrants  

UppercaseComments? Y                  # Y or N 'Require uppercase comments

Drill 2                               # Drilling canned/manual cycle      
G81 z[Depth] b[Rplane] S[Speed] F[Frate] M13 y2
G79 X[H] Y[PointD] Z[V]
G79 X[H] Y[PointD] Z[V]
end

Peck 2                                # Pecking canned/manual cycle       
G83 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2 k[VBite]
G79 X[H] Y[PointD] Z[V]
G79 X[H] Y[PointD] Z[V]
end

Tap 2                                 # Tapping canned/manual cycle       
G84 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2
G79 X[H] Y[PointD] Z[v]
G79 X[H] Y[PointD] Z[v]
end

Ream 2                                # Reaming canned/manual cycle       
G85 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2
G79 X[H] Y[PointD] Z[V]
G79 X[H] Y[PointD] Z[V]
end

Bore 2                                # Boring canned/manual cycle        
G86 z[Depth] b[Rplane] S[Speed] F[Frate] M13 y2
G79 X[H] Y[PointD] Z[V]
G79 X[H] Y[PointD] Z[V]
end

Back                                  # Back boring canned/manual cycle   
end cancel

Cancel                                # Cancel a canned/manual cycle      
G80
end

                                      # Index the rotary table            
          # Ask [Val1] "Enter Retract value in Z before rotary posit. : " "100"
          # g91
          # G0 Z[Val1]
          # G90
          # G0 B[Rotangle]
          # end

StartCode                             # Start of the program              
Ask [Val7] " Enter Retract value in Y for toolchange : " "100"
Ask [Val6] " Enter M-Function for toolchange         : " "6"
Ask [Val8] " Enter Offset number                     : " "54"
%0
!0 N[Program#]
End

1stToolChange                         # First tool change                 
G18 T[Tool] M[Val6]
G51
G53
G[Val8]
G90
G0 X[H] Z[V] Y[D] S[Speed] F[FRate] M13
End

Infeed                                # Enable cutter comp                
G1 Y[D] F[Plunge]
G43 X[H] Z[V] F[FRate]
G[Side]
end

Outfeed                               # Disable cutter comp               
G40
G1 X[H] Z[V]
end

ToolChange                            # Secondary tool changes            
G0 Y[Val7]
T[Tool] M[Val6]
G0 X[H] Z[V] Y[D] S[Speed] F[FRate] M13
End

EndCode                               # End of the program                
G0 Y[Val7]
G53
M30
W0
End

Replace "%" with "%PM"
